﻿@model ConferencePaymentModel
@{
	ViewBag.Title = Resources.ConferencePayment + ConstValues.strDash + ViewBag.ConferenceName;
}
<div id="menuBar" style="height:35px;">
	<div style="float: left; padding: 5px 5px; font-weight: bold; text-align: left;">
		@Resources.PaidType：<input id="selPaidType" class="easyui-textbox" style="height:27px; width:200px;" />&nbsp;&nbsp;
		<a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" onclick="searchData();">@Resources.Search</a>&nbsp;&nbsp;
		@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId) || Utility.HasConferenceRole((User as ICISPrincipal), Model.ConferenceId, ConstValues.FunctionId.ConferencePayment, RoleType.添加))
		{
			<a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-add" onclick="addData();" plain="true">@Resources.Create</a>
		}
	</div>
	<div class="clear"></div>
</div>
<div id="dataGrid"></div>

@section bodyParts {
<div id="detailWindow" class="easyui-window"
	title="@Resources.ConferencePayment" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="detailWindowTitle" class="tit01"></h3>
			<form id="frmDetail" method="post" enctype="multipart/form-data">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.ConferenceName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input type="hidden" id="hidID" name="Id" />
							<input type="hidden" id="hidConferenceId" name="conferenceId" />
							<input id="txtConferenceName" disabled class="easyui-textbox" style="height:27px; width:300px;" value="@ViewBag.ConferenceName">
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.PaidType：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtPaidType" name="paidId" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Status：</td>
						<td style="text-align: left;" class="w2 c4">
							<select id="ddlStatus" name="status" class="easyui-combobox" style="height:27px; width:300px;" data-options="editable:false,required:true,panelHeight:'auto'">
								<option value="@ConstValues.Status.正常">@Resources.Normal</option>
								<option value="@ConstValues.Status.暂停">@Resources.Pause</option>
							</select>
						</td>
						<td style="text-align: right;" class="w1 c3">@Resources.Sort：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtSort" name="sort" class="easyui-numberbox" style="height:27px; width:300px;" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Remark：</td>
						<td style="text-align: left;" class="w2 c2" colspan="3">
							<input id="txtRemark" name="remark" class="easyui-textbox" style="height:50px; width:892px;" data-options="multiline:true,validType:['length[1,1000]']" />
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="hidden" id="hdnWindowType" />
				<input type="button" class="gbtn" onclick="saveData();" value="@Resources.Save" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#detailWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<div id="aliPayWindow" class="easyui-window"
	title="@Resources.ConferencePayment" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="aliPayWindowTitle" class="tit01"></h3>
			<form id="aliPayDetail" method="post" enctype="multipart/form-data">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="aliPayJudge" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.ConferenceName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="alitxtConferenceName" disabled class="easyui-textbox" style="height:27px; width:300px;" value="@ViewBag.ConferenceName">
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.AccountName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="aliHidID" name="Id" type="hidden" />
							<input type="hidden" id="aliHidConferenceId" name="aliConferenceId" />
							<input id="txtAccountName" name="accountName" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">Partner：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtPartner" name="partner" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">

						</td>
						<td style="text-align: right;" class="w1 c3">SellerEmail：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtSellerEmail" name="sellerEmail" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['email','length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">Alipaykey：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtAlipaykey" name="alipaykey" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
						<td style="text-align: right;" class="w1 c1">InputCharset：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtInputCharset" name="inputCharset" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">SignType：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtSignType" name="signType" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
						<td style="text-align: right;" class="w1 c3">AppId</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtAppId" name="appId" class="easyui-textbox" style="height:27px; width:300px;" data-options="validType:['length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">Rsa：</td>
						<td style="text-align: left;" class="w2 c2" colspan="3">
							<input id="txtRsa" name="rsa" class="easyui-textbox" style="height:100px; width:892px;" data-options="multiline:true" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Status：</td>
						<td style="text-align: left;" class="w2 c4">
							<select id="aliStatus" name="aliStatus" class="easyui-combobox" style="height:27px; width:300px;" data-options="editable:false,required:true,panelHeight:'auto'">
								<option value="@ConstValues.Status.正常">@Resources.Normal</option>
								<option value="@ConstValues.Status.暂停">@Resources.Pause</option>
							</select>
						</td>
						<td style="text-align: right;" class="w1 c3">@Resources.Sort：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="aliSort" name="aliSort" class="easyui-numberbox" style="height:27px; width:300px;" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Remark：</td>
						<td style="text-align: left;" class="w2 c2" colspan="3">
							<input id="aliRemark" name="aliRemark" class="easyui-textbox" style="height:50px; width:892px;" data-options="multiline:true,validType:['length[1,1000]']" />
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="button" class="gbtn" onclick="saveAliData();" value="@Resources.Save" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#aliPayWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<div id="ePayWindow" class="easyui-window"
	title="@Resources.ConferencePayment" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="ePayWindowTitle" class="tit01"></h3>
			<form id="ePayDetail" method="post" enctype="multipart/form-data">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="ePayJudge" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.ConferenceName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="etxtConferenceName" disabled class="easyui-textbox" style="height:27px; width:300px;" value="@ViewBag.ConferenceName">

						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.TenantId：</td>
						<td style="text-align: left;" class="w2 c2">
							<input type="hidden" id="eHidID" name="Id" />
							<input type="hidden" id="eHidConferenceId" name="eConferenceId" />
							<input id="txtTenantId" name="TenantId" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">PayEaseKey：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtEPayKey" name="ePayKey" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
						<td style="text-align: right;" class="w1 c3">@Resources.TenantName：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtTenantName" name="tenantName" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.TenantAddress：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtTenantAddress" name="tenantAddress" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.TenantTel：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtTenantTel" name="tenantTel" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.TenantMail：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtTenantMail" name="tenantMail" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['email','length[1,100]']">

						</td>
						<td style="text-align: right;" class="w1 c3">@Resources.TenantPost：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtTenantPost" name="tenantPost" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true,validType:['length[1,100]']">
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">Country：</td>
						<td style="text-align: left;" class="w2 2">
							<input id="country" name="country" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true">
						</td>
						<td style="text-align: right;" class="w1 c1">State：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="state" name="state" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true">
						</td>
					</tr>
					<tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">City：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="city" name="city" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true">
						</td>
						<td style="text-align: right;" class="w1 c3"></td>
						<td style="text-align: left;" class="w2 c4"></td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Status：</td>
						<td style="text-align: left;" class="w2 c2">
							<select id="eStatus" name="eStatus" class="easyui-combobox" style="height:27px; width:300px;" data-options="editable:false,required:true,panelHeight:'auto'">
								<option value="@ConstValues.Status.正常">@Resources.Normal</option>
								<option value="@ConstValues.Status.暂停">@Resources.Pause</option>
							</select>
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.Sort：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="eSort" name="eSort" class="easyui-numberbox" style="height:27px; width:300px;" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Remark：</td>
						<td style="text-align: left;" class="w2 c4" colspan="3">
							<input id="eRemark" name="eRemark" class="easyui-textbox" style="height:50px; width:892px;" data-options="multiline:true,validType:['length[1,1000]']" />
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="button" class="gbtn" onclick="saveEPayData();" value="@Resources.Save" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#ePayWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
}

@section Scripts {
<script>
	common.setCurrentMenu("ConferencePayment");
	common.setCurrentParentMenu("#menu_a1");

	$(function () {
		$("#selPaidType").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		$("#hidConferenceId").val("@Model.ConferenceId");
		$("#dataGrid").datagrid({
			url: "@Url.Action(nameof(ConferencePaymentController.GetData),
				nameof(ConferencePaymentController).GetControllerName(),new { ConferenceId = Model.ConferenceId })",
			method: "get",
			singleSelect: true,
			fitColumns: true,
			width: $(window).width() - 285,
			height: $(window).height() - 158,
			nowrap: false,
			pagination: true,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#toolBar",
			pageSize: 100,
			pageList: [100, 200, 300, 400, 500],
			columns: [[
				{ field: "id", hidden: true },
				@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId) ||
					Utility.HasConferenceRole((User as ICISPrincipal), Model.ConferenceId, ConstValues.FunctionId.ConferencePayment, RoleType.修改) ||
					Utility.HasConferenceRole((User as ICISPrincipal), Model.ConferenceId, ConstValues.FunctionId.ConferencePayment, RoleType.删除))
				{
					<text>
					{
					        field: "operate", title: "@Resources.Operate", align: "center", width: 150,
					        formatter: function(value, rec) {
					        	var strInfo = "";
							var tmp = rec.paymentName == null ? "" : rec.paymentName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
					        	@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId) || Utility.HasConferenceRole((User as ICISPrincipal), Model.ConferenceId, ConstValues.FunctionId.ConferencePayment, RoleType.修改))
						        {
								<text>
					        		if (rec.isInternational == true) {
					        			if (rec.paymentName == "@ConstValues.PayType.AliPay" || rec.paymentName == "@ConstValues.PayType.PayEase") {
					        				strInfo += "<a href='#' style='color:#FF8C00;font-weight:bold;text-decoration:underline;' onclick='accountData(\""
											+ rec.id + "\",\"" + tmp + "\")'>@Resources.Account</a>";
					        			}
					        		} else {
					        			if (rec.paymentName == "@ConstValues.PayType.支付宝" || rec.paymentName == "@ConstValues.PayType.易支付") {
					        				strInfo += "<a href='#' style='color:#FF8C00;font-weight:bold;text-decoration:underline;' onclick='accountData(\""
											+ rec.id + "\",\"" + tmp + "\")'>@Resources.Account</a>";
					        			}
					        		}
								if (strInfo != "") {
					        			strInfo += "&nbsp;|&nbsp;";
								}
					        		strInfo += "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='editData(\""
									+ rec.id + "\")'>@Resources.Modify</a>";
					        		</text>
						        }
					        	@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId) || Utility.HasConferenceRole((User as ICISPrincipal), Model.ConferenceId, ConstValues.FunctionId.ConferencePayment, RoleType.删除))
							{
								<text>
					        		if (strInfo != "") {
					        			strInfo += "&nbsp;|&nbsp;";
					        		}
					        		strInfo += "<a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='deleteData(\""
									+ rec.id + "\",\"" + tmp + "\")'>@Resources.Delete</a>";
					        		</text>
							}
					        	return strInfo;
					        }
					},
					</text>
				}
				{ field: "paymentName", title: "@Resources.PaidType", align: "center", sortable: true, width: 150 },
				{
					field: "status", title: "@Resources.Status", align: "center", sortable: true, width: 100,
					formatter: function(value, rec) {
                    				if (value=="@ConstValues.Status.正常") {
                    					return "@Resources.Normal"
                    				} else {
                    					return "@Resources.Pause"
                    				}
					}
				},
				{ field: "sort", title: "@Resources.Sort", align: "center", sortable: true, width: 100 },
				{ field: "remark", title: "@Resources.Remark", align: "center", sortable: true, width: 200 },
				{ field: "creator", title: "@Resources.Creator", align: "center", sortable: true, width: 100 },
				{ field: "createIP", title: "@Resources.CreateIP", align: "center", sortable: true, width: 150 },
				{ field: "createDate", title: "@Resources.CreateDate", align: "center", sortable: true, width: 150 },
			]],
			onBeforeLoad: function(param) {
				param.random = Math.random();
				param.conferenceId = $("#hidConferenceId").val();
			}
		});

		$(window).resize(function () {
			$("#dataGrid").datagrid("resize", {
				width: $(window).width() - 285,
				height: $(window).height() - 158
			});
		});

		$("#detailWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});

		$("#aliPayWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});

		$("#ePayWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});
	});

	function deleteData(id, name) {
		var confirmMessage = "@Resources.CfmDelete";
		confirmMessage = confirmMessage.replace(/\{0\}/g, name);
		$.messager.confirm("@Resources.Delete", confirmMessage, function (r) {
			if (r) {
				$("#hidID").val(id);
				$.post("@Url.Action(nameof(ConferencePaymentController.Delete),
						nameof(ConferencePaymentController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
					$("#frmDetail").serialize(),
					function(data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxFailResult") {
					    		common.showError(data.message);
						} else {
					    		common.showSuccess(data.message, true);
					    		$("#dataGrid").datagrid("reload");
						}
					}
				);
			}
		});
	};

	function addData() {
		$("#hdnWindowType").val("add");
		$("#detailWindowTitle").text("@Resources.Create");
		$("#txtSort").numberbox("setValue", @ConstValues.DefaultSort);
		$("#txtPaidType").combobox({
			url: "@Url.Action(nameof(ConferencePaymentController.GetPayType),
					nameof(ConferencePaymentController).GetControllerName())?conferenceId=@Model.ConferenceId",
			valueField: "id",
			textField: "name",
			editable: false,
			required: true,
			panelHeight: "auto",
		});
		$("#txtRemark").textbox("setValue","");
		$("#detailWindow").window("open");
	}

	function editData(id) {
		var url = "@Url.Action(nameof(ConferencePaymentController.GetEditData),
				nameof(ConferencePaymentController).GetControllerName())" + "/" + id;
		$.get(url, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxFailResult") {
				common.showError(data.message);
				$("#dataGrid").datagrid("reload");
			} else {
				$("#txtPaidType").combobox({
					url: "@Url.Action(nameof(ConferencePaymentController.GetPayType),
							nameof(ConferencePaymentController).GetControllerName())?conferenceId=@Model.ConferenceId",
					valueField: "id",
					textField: "name",
					editable: false,
					required: true,
					panelHeight: "auto",
				});
				$("#txtPaidType").combobox("setValue",data.data.paymentName);
				$("#ddlStatus").combobox("setValue",data.data.status);
				$("#txtSort").numberbox("setValue", data.data.sort);
				$("#txtRemark").textbox("setValue",data.data.remark);
				$("#hidID").val(id);
				$("#hdnWindowType").val("edit");
				$("#detailWindowTitle").text("@Resources.Modify");
				$("#detailWindow").window("open");
			}
		});
	}

	function saveData() {
		var isValid = $("#frmDetail").form("validate");

		if (isValid) {
			$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
				if (r) {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});
					switch ($("#hdnWindowType").val())
					{
						case "add":
							$.post("@Url.Action(nameof(ConferencePaymentController.Create),
									nameof(ConferencePaymentController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
								$("#frmDetail").serialize(),
								function(data, textStatus, jqXHR) {
									layer.close(loading);
									if (data.result == "@ConstValues.AjaxFailResult") {
										common.showError(data.message);
									} else {
										common.showSuccess(data.message, true);
										$("#detailWindow").window("close");
										$("#dataGrid").datagrid("reload");
									}
								}
							);
							break;
						case "edit":
							$.post("@Url.Action(nameof(ConferencePaymentController.Modify),
									nameof(ConferencePaymentController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
								$("#frmDetail").serialize(),
								function(data, textStatus, jqXHR) {
									layer.close(loading);
									if (data.result == "@ConstValues.AjaxFailResult") {
										common.showError(data.message);
									} else {
										common.showSuccess(data.message, true);
										$("#detailWindow").window("close");
										$("#dataGrid").datagrid("reload");
									}
								}
							);
							break;
					}
				}
			})
		}
	};

	function searchData() {
		$("#dataGrid").datagrid("load", {
			SelPaidType: $("#selPaidType").textbox("getValue")
		});
	}

	function accountData(id, paymentName) {
		$("#aliHidConferenceId").val("@Model.ConferenceId")
		$("#eHidConferenceId").val("@Model.ConferenceId")
		if (paymentName == "@ConstValues.PayType.支付宝" || paymentName == "@ConstValues.PayType.AliPay") {
			var url = "@Url.Action(nameof(ConferencePaymentController.GetAliData),
					nameof(ConferencePaymentController).GetControllerName())"+"?conferenceId=" +"@Model.ConferenceId";
			$.get(url, null, function (data, textStatus, jqXHR) {
				if (data.result == "@ConstValues.AjaxFailResult") {
					$("#txtAccountName").textbox("setValue","");
					$("#txtPartner").textbox("setValue","");
					$("#txtSellerEmail").textbox("setValue","");
					$("#txtAlipaykey").textbox("setValue","");
					$("#txtInputCharset").textbox("setValue","");
					$("#txtSignType").textbox("setValue","");
					$("#txtAppId").textbox("setValue","");
					$("#txtRsa").textbox("setValue","");
					$("#aliStatus").combobox("setValue", "@ConstValues.Status.正常");
					$("#aliSort").numberbox("setValue", @ConstValues.DefaultSort);
					$("#aliRemark").textbox("setValue","");
				} else {
					$("#txtAccountName").textbox("setValue",data.data.accountName);
					$("#txtPartner").textbox("setValue",data.data.partner);
					$("#txtSellerEmail").textbox("setValue",data.data.sellerMail);
					$("#txtAlipaykey").textbox("setValue",data.data.alipayKey);
					$("#txtInputCharset").textbox("setValue",data.data.inputCharset);
					$("#txtSignType").textbox("setValue",data.data.signType);
					$("#txtAppId").textbox("setValue",data.data.appId);
					$("#txtRsa").textbox("setValue",data.data.rsa);
					$("#aliStatus").combobox("setValue", data.data.status);
					$("#aliSort").numberbox("setValue", data.data.sort);
					$("#aliRemark").textbox("setValue",data.data.remark);
				}
				$("#aliPayWindowTitle").text("@Resources.AliPay");
				$("#aliPayWindow").window("open");
			});
		} else if (paymentName == "@ConstValues.PayType.易支付" || paymentName == "@ConstValues.PayType.PayEase") {
			var url = "@Url.Action(nameof(ConferencePaymentController.GetEPayData),
					nameof(ConferencePaymentController).GetControllerName())"+"?conferenceId=" +"@Model.ConferenceId";
			$.get(url, null, function (data, textStatus, jqXHR) {
				if (data.result == "@ConstValues.AjaxFailResult") {
					$("#txtTenantId").textbox("setValue","");
					$("#txtEPayKey").textbox("setValue","");
					$("#txtTenantName").textbox("setValue","");
					$("#txtTenantAddress").textbox("setValue","");
					$("#txtTenantTel").textbox("setValue","");
					$("#txtTenantMail").textbox("setValue","");
					$("#txtTenantPost").textbox("setValue","");
					$("#country").textbox("setValue","");
					$("#state").textbox("setValue","");
					$("#city").textbox("setValue","");
					$("#eStatus").combobox("setValue", "@ConstValues.Status.正常");
					$("#eSort").numberbox("setValue", @ConstValues.DefaultSort);
					$("#eRemark").textbox("setValue","");
				} else {
					$("#txtTenantId").textbox("setValue",data.data.tenantId);
					$("#txtEPayKey").textbox("setValue",data.data.key);
					$("#txtTenantName").textbox("setValue",data.data.tenantName);
					$("#txtTenantAddress").textbox("setValue",data.data.tenantAddress);
					$("#txtTenantTel").textbox("setValue",data.data.tenantPhone);
					$("#txtTenantMail").textbox("setValue",data.data.tenantMail);
					$("#txtTenantPost").textbox("setValue",data.data.tenantPostcode);
					$("#country").textbox("setValue",data.data.country);
					$("#state").textbox("setValue",data.data.city);
					$("#city").textbox("setValue",data.data.area);
					$("#eStatus").combobox("setValue", data.data.status);
					$("#eSort").numberbox("setValue", data.data.sort);
					$("#eRemark").textbox("setValue",data.data.remark);
				}
				$("#ePayWindowTitle").text("@Resources.Epay");
				$("#ePayWindow").window("open");
			});
		}
	}

	function saveAliData() {
		var isValid = $("#aliPayDetail").form("validate");

		if (isValid) {
			$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
				if (r) {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});

					$.post("@Url.Action(nameof(ConferencePaymentController.CreateAli),
							nameof(ConferencePaymentController).GetControllerName())",
						$("#aliPayDetail").serialize(),
						function(data, textStatus, jqXHR) {
							layer.close(loading);
							if (data.result == "@ConstValues.AjaxFailResult") {
								common.showError(data.message);
							} else {
								common.showSuccess(data.message, true);
								$("#aliPayWindow").window("close");
								$("#dataGrid").datagrid("reload");
							}
						}
					)
				}
			})
		}
	}

	function saveEPayData() {
		var isValid = $("#ePayDetail").form("validate");

		if (isValid) {
			$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
				if (r) {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});

					$.post("@Url.Action(nameof(ConferencePaymentController.CreateE),
							nameof(ConferencePaymentController).GetControllerName())",
						$("#ePayDetail").serialize(),
						function(data, textStatus, jqXHR) {
							layer.close(loading);
							if (data.result == "@ConstValues.AjaxFailResult") {
								common.showError(data.message);
							} else {
								common.showSuccess(data.message, true);
								$("#ePayWindow").window("close");
								$("#dataGrid").datagrid("reload");
							}
						}
					)
				}
			})
		}
	}
</script>
}